#define _CRT_SECURE_NO_WARNINGS 1

#include<string>
#include<iostream>

using namespace std;

int main()
{
    string s;
    getline(cin, s);
    int letter = 0, num = 0, space = 0, rest = 0;
    for (auto e : s)
    {
        if ((e >= 'a' && e <= 'z') || (e >= 'A' && e <= 'Z'))
        {
            letter++;
        }
        else if (e >= '0' && e <= '9')
        {
            num++;
        }
        else if (e == ' ')
        {
            space++;
        }
        else
        {
            rest++;
        }
    }
    cout << letter << ' ' << num << ' ' << space << ' ' << rest << endl;

    return 0;
}